package com.ws.lv.service.impl;

import com.ws.lv.bean.User;
import com.ws.lv.mapper.UserMapper;
import com.ws.lv.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public int insertUser(User user) {
        return userMapper.insertUser(user);
    }

    @Override
    public User selectUserByUser_name(String user_name) {
        return userMapper.selectUserByUser_name(user_name);
    }

    @Override
    public List<User> selectUsers(String user_name, String user_phone) {
        return userMapper.selectUsers(user_name,user_phone);
    }

    @Override
    public User selectUserByUser_id(int user_id) {
        return userMapper.selectUserByUser_id(user_id);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }

    @Override
    public int updateUserPass(String newPass, int user_id) {
        return userMapper.updateUserPass(newPass,user_id);
    }

    @Override
    public int deleteUsers(ArrayList<Integer> user_ids) {
        return userMapper.deleteUsers(user_ids);
    }

    @Override
    public int deleteUser(int user_id) {
        return userMapper.deleteUser(user_id);
    }
}
